
const express = require('express')
//导入路由模块
const router = require('./router/router')
var app = express();

app.get('/', function (req, res) {
    res.send('Hello World');
})

// 注册路由模块，添加访问前缀
app.use('/api', router)

var server = app.listen(8081, function () {

    var host = server.address().address
    var port = server.address().port

    console.log("应用实例，访问地址为 http://%s:%s", host, port)

})

//https://juejin.cn/post/7089808269736149023